# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Johannes Wienke <languitar at semipol dot de>
# Contributor: Danilo Bargen <aur at dbrgn dot ch>

pkgname=geotag
pkgver=0.103
pkgrel=5
pkgdesc='Match date/time information from photos with location information from a GPS unit or from a map'
arch=('any')
url='http://geotag.sourceforge.net/'
license=('GPL')
depends=('hicolor-icon-theme' 'java-runtime' 'perl-image-exiftool')
optdepends=('dcraw: display preview for RAW images'
            'gpsbabel: load tracks from GPS')
source=("https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.jar"
        'https://repo1.maven.org/maven2/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar'
        "$pkgname.desktop"
        "$pkgname.appdata.xml"
        "$pkgname.sh")
noextract=("$pkgname-$pkgver.jar")
sha256sums=('9c12b0bdc8e497b461a5fb1611175e7c26750617febc70dd92b5c7783d69b2ba'
            '88b955a0df57880a26a74708bc34f74dcaf8ebf4e78843a28b50eae945732b06'
            '8bce60d5a6c8ac61a4e72f433fcb921cc4df7ded3ffb954838aedc07f9ae8c0a'
            'a0ed07e35fb3e632dc4aceb464d8c04e602847bf94f65854debf9ed36ebf3c93'
            '81ea7d4b35c85c7b032bfaba2caeb319ced2550692d4f739c68a94b741682066')

prepare() {
  bsdtar -xf $pkgname-$pkgver.jar images/$pkgname-128.png
}

package() {
  install -Dm644 $pkgname-$pkgver.jar "$pkgdir/usr/share/java/$pkgname/$pkgname.jar"
  install -Dm644 jaxb-api-2.3.1.jar "$pkgdir/usr/share/java/$pkgname/lib/jaxb-api.jar"
  install -Dm755 $pkgname.sh "$pkgdir/usr/bin/$pkgname"
  install -Dm644 $pkgname.desktop "$pkgdir/usr/share/applications/$pkgname.desktop"
  install -Dm644 $pkgname.appdata.xml "$pkgdir"/usr/share/metainfo/$pkgname.appdata.xml
  install -Dm644 images/$pkgname-128.png "$pkgdir/usr/share/icons/hicolor/128x128/apps/$pkgname.png"
}
